package tk0084.dev.google.quiz.lite;

import java.util.ArrayList;
import java.util.List;

public class State implements Comparable<State> {

	private Table _table;
	private Operation _prevOperation;
	public static Integer FIRST_ORDER = 0;

	@Override
	public boolean equals(Object o) {
		State s = (State) o;

		return _table.equals(s.getTable());
	}

	public Table getTable() {
		return _table;
	}
	
	public int compareTo(State o) {
		if (equals(o)) {
			return 0;
		}
		return 1;
	}

	public static int getStateHashCode(char[] chars) {
		int len = chars.length;
		int off = 0;
		int h = 0;
		char[] val = chars;

		for (int i = 0; i < len; i++) {
			h = 31 * h + val[off++];
		}

		return h;
	}
}
